<template>
    <div class="box">
        <div class="top">
            <div class="left">
                <i :class="iNavClass ? 'el-icon-s-fold' : 'el-icon-s-unfold'" @click="navClick"></i>
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <!-- <el-breadcrumb-item :to="{path:'/index'}">
                        首页
                    </el-breadcrumb-item> -->
                    <el-breadcrumb-item v-for='item,index in this.$store.state.rightTopNav' :key="index" :to="{ path:item.path }">
                        {{item.text}}
                    </el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="right">
                <el-row class="block-col-2">
                    <el-col>
                        <el-dropdown trigger="click">
                            <span class="el-dropdown-link">
                                Admin<i class="el-icon-arrow-down el-icon--right"></i>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item @click.native="add">个人信息</el-dropdown-item>
                                <el-dropdown-item @click.native="sho">主页</el-dropdown-item>
                                <el-dropdown-item @click.native="quit">退出</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </el-col>
                </el-row>
            </div>
        </div>
        <div class="bottom">
            <!-- tab页面 -->
            <LabelView></LabelView>
        </div>
    </div>
</template>
<script>
import { EvnetBus } from '@/eventBus/index';
import LabelView from './LabelView.vue';
export default {
    components: { LabelView },
    data() {
        return {
            iNavClass: true,
        }
    },
    methods: {
        navClick(e) {
            this.iNavClass = !this.iNavClass;
            this.$store.commit('changeisCollapse')
            EvnetBus.$emit("imgA");
        },
        add(){
            this.$router.push("/profile")
        },
        sho(){
            this.$router.push("/examIndex")
        },
        quit(){
            // this.axios({
            //     url:"/api/user/logout",
            //     method:"post"
            // }).then(res=>{
            //     console.log(res);
            //     if(res.data.code==1){
                    const storage = window.localStorage
                    storage.clear()
                    this.$router.push("/")
                // }
            // })
        }
    },
}
</script>
<style lang="scss" scoped>
.box {
    width: 100%;

    .top {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 12px 15px;
        box-sizing: border-box;

        .left {
            display: flex;
            align-items: center;

            >i {
                font-size: 25px;
                margin-right: 20px;
            }
        }
    }
}
</style>